﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no, maximum-scale=1.0" />
    <title>信息查询</title>
    <link rel="stylesheet" type="text/css" href="/css/common.css" />
    <link rel="stylesheet" type="text/css" href="/css/index.css" />
    <link rel="stylesheet" href="/css/pullToRefresh.css" />
</head>

<body class="bg_ef">
    <div class="container">
        <div class="header">
            <div class="headbg"><a href="/index.html" class="return"></a></div>
            <p>信息列表</p>
        </div>
        <main>
            <div class="banner">
                <img src="/image/bg1.png">
            </div>
            <div class="tabs">
                <a class="active">行业资讯</a>
                <a>办事指南</a>
                <input type="hidden" id="CurrentIndex" value="0" />
            </div>
            <div id="tabs-container">
                <div class="tab-slide main" id="wrapper">
                    <ul class="laws" id="lawUl1"></ul>
                </div>
                <div class="tab-slide main hide" id="wrapper2">
                    <ul class="laws" id="lawUl2"></ul>
                </div>
            </div>

        </main>
    </div>
</body>

</html>

<script type="text/javascript" src="/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="/lib/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script>
<script src="/static/usi/core.js"></script>
<script src="/static/usi/tools.js"></script>
<script src="/js/iscroll.js"></script>
<script src="/js/pullToRefresh.js"></script>

<script>
    $(".tabs a").click(function () {
        var ind = $(this).index();
        $(this).addClass('active').siblings().removeClass('active');
        $('#tabs-container').find('.tab-slide').eq(ind).show().siblings().hide();
        var index = $("#CurrentIndex").val();
        $("#CurrentIndex").val(ind);
        //$("#lawUl1").html("");
        //$("#lawUl2").html("");
        //vcurrentPage = 1;
        //isData = true;
        //LoadNewsData();
    })
    refresher.init({
        id: "wrapper",
        divId: "scroller",
        pullUpAction: Load,
        pullDownAction: Refresh,
    });
    refresher.init({
        id: "wrapper2",
        divId: "scroller2",
        pullUpAction: Load2,
        pullDownAction: Refresh2,
    });
    function Refresh() {
        myScroll.refresh();
    }
    function Load() {
        if (isData1) {
            vcurrentPage1 = vcurrentPage1 + 1;
            LoadNewsData();
        }
        myScroll.refresh();
    }
    function Refresh2() {
        myScroll.refresh();
    }
    function Load2() {
        if (isData2) {
            vcurrentPage2 = vcurrentPage2 + 1;
            LoadNewsData();
        }
        myScroll.refresh();
    }
    var vcurrentPage1 = 1;
    var vcurrentPage2 = 1;
    window.onload = function () {
        LoadNewsData1();
        LoadNewsData2();
    }
    var isData1 = true;
    var isData2 = true;
    function LoadNewsData1() {
        //var type;
        //var index = $("#CurrentIndex").val();
        //if (index == "0") {
        //    type = 128;

        //}
        //else if (index == "1") {
        //    type = 64;

        //}
        jQuery.usi.core.get(ip + api + "/GetNewsData", { whereValue: "", currentPage: vcurrentPage1, pageSize:2, type: 128 }, false, function (data) {
            if (!jQuery.usi.core.isNullOrEmpty(data.data)) {
                $.each(data.data, function (indexdata, item) {
                    //var a = $('<a href="#"></a>');
                    //var div = $("<div class='art_list'></div>");

                    //var div1 = $("<div class='title'></div>");
                    //var div1Sub = $("<div class='ver_line'></div>");
                    //var span = $('<span class="overflow-e">' + (jQuery.usi.core.isNullOrEmpty(item.title) ? "" : item.title) + '</span>');
                    //div1.append(div1Sub).append(span);

                    //var div2 = $("<div class='art_con'></div>");
                    //var p2 = $('<p class="exam_p"><span class="lab">发布时间:</span>' + (jQuery.usi.core.isNullOrEmpty(item.releaseTime) ? "" : jQuery.usi.core.formatDate(item.releaseTime)) + '</p>');
                    //div2.append(p1).append(p2);

                    //div.append(div1).append(div2);

                    //a.bind("click", function () {
                    //    window.location.href = "newDetail.html?Unid=" + item.unid;
                    //});
                    //a.append(div);
                    var li = $('<li></li>');
                    var a = $('<a href="#"></a>');
                    var p1 = $('<p class="exam_title">' + (jQuery.usi.core.isNullOrEmpty(item.title) ? "" : item.title) + '</p>');
                    var p2 = $('<p class="exam_p"><span class="lab">发布时间:</span>' + (jQuery.usi.core.isNullOrEmpty(item.releaseTime) ? "" : jQuery.usi.core.formatDate(item.releaseTime)) + '</p>');
                    a.bind("click", function () {
                        window.location.href = "informationDetail.html?Unid=" + item.unid;
                    });
                    a.append(p1).append(p2);
                    li.append(a);
                    //$("#lawUl").append(li);
                    $("#lawUl1").append(li);
                    //if (index == "0")
                    //    $("#lawUl1").append(a);
                    //else if (index == "1")
                    //    $("#lawUl2").append(a);
                });
            } else {
                isData1 = false;
            }
        });

    }
    function LoadNewsData2() {
        jQuery.usi.core.get(ip + api + "/GetNewsData", { whereValue: "", currentPage: vcurrentPage2, pageSize:2, type: 64 }, false, function (data) {
            if (!jQuery.usi.core.isNullOrEmpty(data.data)) {
                $.each(data.data, function (indexdata, item) {
                    var li = $('<li></li>');
                    var a = $('<a href="#"></a>');
                    var p1 = $('<p class="exam_title">' + (jQuery.usi.core.isNullOrEmpty(item.title) ? "" : item.title) + '</p>');
                    var p2 = $('<p class="exam_p"><span class="lab">发布时间:</span>' + (jQuery.usi.core.isNullOrEmpty(item.releaseTime) ? "" : jQuery.usi.core.formatDate(item.releaseTime)) + '</p>');
                    a.bind("click", function () {
                        window.location.href = "informationDetail.html?Unid=" + item.unid;
                    });
                    a.append(p1).append(p2);
                    li.append(a);
                    $("#lawUl2").append(li);
                });
            } else {
                isData2 = false;
            }
        });

    }
</script>
<style>
/*.main {
width:100%
}
.laws {
width:100%;
}*/
</style>